
const express = require('express')
//引入应用joi校验的express-joi包
const expressJoi=require('@escook/express-joi')
// 创建路由实例对象
const router = express.Router()
//引入用户登录注册接口处理模块
const userHandeler = require('../router_handler/user')
//引入用户模块验证规则
const userRuler =require('../schema/user')
// 为实例对象挂载路由
router.post('/login',expressJoi(userRuler), userHandeler.handlelogin)
// 用户注册路由
// 注册局部中间件:添加第二个参数expressJoi(具体规则),为当前
router.post('/reguser',expressJoi(userRuler), userHandeler.handleReguser)

module.exports = router         